import net.egork.io.IOUtils;
import net.egork.utils.Solver;
import net.egork.utils.io.InputReader;

import java.io.PrintWriter;

public class C11BN implements Solver {
    public void solve(int testNumber, InputReader in, PrintWriter out) {

        char s[] = in.readString().toCharArray();
        int n = s.length - 1;
        if (s[0] == '1' && n == 1) {
            out.println(0);
            return;
        }

        int ans = 0;
        while (s[n] == '0') {
            ++ans;
            --n;
        }
        if (n == 1) {
            out.println(ans);
            return;
        }

        while (n > 0) {
            int i = n - 1;
            while (i >= 0 && s[i] == '1')
                --i;
            ans += (n - i + 1);
            n = i;
        }

        out.println(ans);
    }
}

